$('#messusr').hover(
    function(){
        $('#section-usr').css('display','block');
    },
    function(){
        $('#section-usr').css('display','none');
    }
);
$('#cxmess').hover(
    function(){
        $('#messioi').css('display','block');
    },
    function(){
        $('#messioi').css('display','none');
    }
);
$(document).bind('propertychange input', function () {
    //获取输入框的内容字数
    var fontlength = $('#fontinput').val().length;

    $('#inputnum').html(fontlength);

});

$('#fontinput').focus(function(){
   $('#content-tj').css('display','none');
   $('#zlili').css('display','block');
    $('#successci').css('display','none');
});

$('#fontinput').focusout(function(){
    var fontlength = $('#fontinput').val().length;
    if(fontlength ==0) {
        $('#content-tj').css('display', 'block');
        $('#zlili').css('display', 'none');
    }
});

$('#pushcont').click(function(){
   alert($('#fontinput').val());
});
//表情框
// $('#lvtanj').click(function(){
//    $('#emoji_container_1').css('display','block');
//});


//动态点赞
$('.lmdzi').live('click',function(){
    //动态id
    var zid = $(this).attr('zidi');
    $.ajax({
       type:'get',
        url:'dynicdz?id='+zid,
        dataType:'json',
        success:function(data){
          if(data == 1) {
           $('.dzyans'+zid).css('color','red');
           $('#tubi'+zid).css('color','red');
           $('#dianiq'+zid).html(parseInt($('#dianiq'+zid).html()) + 1);
          } else {
              $('.dzyans'+zid).css('color','#333');
              $('#tubi'+zid).css('color','#333');
              $('#dianiq'+zid).html(parseInt($('#dianiq'+zid).html()) - 1);
          }
        },
        error:function(){
            alert(2);
        }

    });


});
//动态收藏
$('.mysupsc').live('click',function(){
    var sid = $(this).attr('sid');
    $.ajax({
       type:'get',
       url:'dyinsc?sid='+sid,
       dataType:'json',
       success:function(data){
           if(data == 1) {

               $('#supqi'+sid).css('color','red');

           } else {

               $('#supqi'+sid).css('color','#333');

           }
       },
       error:function(){
         alert('cuow');
       }
    });

});

//评论弹框
$('.My_pl').live('click',function(){
    var a = $(this).attr('mydb');
    var img = $(this).attr('myimg');

    $.ajax({
     type:'get',
     url:'getplinfo?plid='+a,
     dataType:'json',
     success:function(data){
      // alert(data);
    //一级评论内容
         var one = '';
     for (var i =0;i<data.length;i++) {
          one += '<div  class="list_li S_line1 clearfix" >';
         one += ' <!-- 评论头像 -->';
         one += '<div class="WB_face W_fl">';
         one += '<a target="_blank" href="http://"><img alt="男士时尚穿搭" src="'+data[i].pimg+'" ></a>';
         one += '</div>';
         one += '<!-- 评论头像 -->';
         one += '<!-- 评论用户信息及评论内容 -->';
         one += '<div class="list_con">';
         one += '<div class="WB_text">';
         one += '<a target="_blank" href="http://">'+data[i].plname+'</a>';
         one += '<a target="_blank"  href="http:/"><i title="微博个人认证 " class="W_icon icon_approve_gold"></i></a>';
         one += '<a action-type="ignore_list" title="微博会员" target="_blank" href="http://v"><em class="W_icon icon_member5"></em></a>'+data[i].content;
         // one += '<a title="夏季日式新品薄款牛仔短裤男士五分裤男装5分..." href="http://t.cn/RoSVQ05" alt="http://"  target="_blank"><i class="W_ficon ficon_cd_link">O</i>夏季日式新品薄款牛仔短裤男士五分裤男装5分...</a></div>';
         one += '<!-- 评论图片的处理 -->';
         one += '<div class="WB_expand_media_box"style="display: none;"></div>';
         one += '<!-- 评论图片的处理 -->';
         one += '<!-- 对评论的操作 -->';
         one += '<div class="WB_func clearfix">';
         one += '<div class="WB_handle W_fr">';
         one += '<ul class="clearfix">';
         one += '<!-- 举报 -->';
         one += '<li class="hover"><span class="line S_line1"><a class="S_txt1" href="javascript:void(0);" >举报</a></span></li>';
         one += '<!-- 举报 -->';
         one += '<!-- 屏蔽 -->';
         one += '<li class="hover"><span class="line S_line1"><a class="S_txt1" href="javascript:void(0);">屏蔽</a></span></li>';
         one += '<!-- 屏蔽 -->';
         one += '<!-- 删除 -->';
         one += '<!-- 删除 -->';
         one += '<!-- 查看对话 -->';
         one += '<!-- 查看对话 -->';
         one += '<!-- 回复 -->';
         one += '<li>';
         one += '<span class="line S_line1"><a href="javascript:void(0);" class="S_txt1 " onclick="return false" >回复</a></span>';
         one += '<span class="arrow"><span class="W_arrow_bor W_arrow_bor_t"><i class="S_bg2_br"></i></span></span>';
         one += '</li>';
         one += '<!-- 回复 -->';
         one += '<!-- 赞 -->';
         one += '<li><span class="line S_line1">';
         one += '<a href="javascript:void(0)" class="S_txt1 mydiz" dzid="'+data[i].id+'"><span class=""><em class="W_ficon ficon_praised S_txt2">ñ</em><em>赞</em></span></a>';
         one += '</span></li>';
         one += '<!-- 赞 -->';
         one += '</ul>';
         one += '</div>';
         one += '<!-- 时间 -->';
         one += '<div class="WB_from S_txt2">'+data[i].dc_time+'</div>';
         one += '<!-- 时间 -->';
         one += '</div>';
         one += '<!-- 二级评论 -->';
         one += '<!-- 如果返回的为空，但是有二级评论 -->';
         one += '<!-- 如果返回的为空，但是有二级评论 -->';
         one += '<!-- 如果返回有二级评论 -->';
         one += '<!-- 为评论假写留下二级评论的样式框架评论 -->';
         one += '<div class="list_box_in S_bg3" style="display:none">';
         one += '<div class="list_ul" >';
         one += '<div class="between_line S_bg1"></div>';
         one += '</div>';
         one += '</div>';
         one += '<!-- 为评论假写留下二级评论的样式框架评论 -->';
         one += '<!-- 如果返回有二级评论 -->';
         one += '<!-- 二级评论 -->';
         one += '<!-- 对一级评论的操作 -->';
         one += '</div>';
         one += '<!-- 一级评论用户信息及评论内容 -->';
         one += '</div>';
     }//for
    console.log(one);
    //--一级评论
    var plhtml = '';
    plhtml += '<div class="WB_feed_repeat S_bg1 WB_feed_repeat_v3" id="plsoni'+a+'">';
    plhtml +=' <div class="WB_repeat S_line1">';
    plhtml +=' <!-- 评论-发表 -->';
    plhtml +='<div class="WB_feed_publish clearfix">';
    plhtml +='<div class="WB_face W_fl"><img src="'+img+'" ></div>';
    plhtml +='<div class="WB_publish">';
    plhtml +='<div class="p_input">';
    plhtml +='<textarea class="W_input" cols="" rows="" name=""  style="margin: 0px; padding: 5px 2px 0px 6px; border-style: solid; border-width: 1px; font-size: 12px; word-wrap: break-word; line-height: 18px; overflow: hidden; outline: none; height: 23px;" id="textciti'+a+'"></textarea>';
    plhtml +='</div>';
    plhtml +='<div class="p_opt clearfix" >';
    plhtml +='<div class="btn W_fr"><a class="W_btn_a W_btn_a_disable lmgty"href="javascript:void(0);" onclick="return false" dtid="'+a+'">评论</a></div>';
    plhtml +=' <div class="opt clearfix">';
    plhtml +='<span class="ico"><a href="javascript:;"  title="表情" alt="表情"><i class="W_ficon ficon_face">o</i></a>';
    plhtml +='<a  href="javascript:void(0);"style="cursor:default;" title=""><i class="W_ficon ficon_image S_ficon_dis">O</i></a>';
    plhtml +='</span>';
    plhtml +='</div>';
    plhtml +='</div>';
    plhtml +='</div>';
    plhtml +='</div>';
    plhtml +='<!-- 评论-列表 -->';
    plhtml +='<div class="repeat_list">';
    plhtml +='<!-- 列表-内容 -->';
    plhtml +='<div class="list_box">';
    plhtml +='<div class="list_ul" id="plparami'+a+'">';
    plhtml += one;
    plhtml +='</div>';
    plhtml +='</div>';
    plhtml +='<!-- 列表-内容 -->';
    plhtml +='</div>';
    plhtml +='<!-- 评论-列表 -->';
    plhtml +='</div>';
    plhtml +='</div>';
    //alert('#ismycont'+a);
    if($('#plsoni'+a).length>0) {
          $('#plsoni'+a).detach();
    } else {
        $('#ismycont'+a).append(plhtml);
    }
     },//成功
    error:function(){
         alert(2);
    }

});//ajax入口
});
//一级评论点赞
$('.mydiz').live('click',function(){
   var did = $(this).attr('dzid');
   $.ajax({
       type:'get',
       url:'onedz?id='+did,
       dataType:'json',
       success:function(data){
          alert(data);
       },
       error:function(){
          alert(2);
       }
   })
});
//评论按钮
$('.lmgty').live('click',function(){
    var a = $(this).attr('dtid');
    var content = $('#textciti'+a).val();

    $.ajax({
       type:'get',
       dataType:'json',
       url:'mypl?content='+content+'&id='+a,
       success:function(data){
           $('#textciti'+a).val('');

           var htm = '<div  class="list_li S_line1 clearfix" id="hjli'+data.plid+'">';
              htm+='<div class="WB_face W_fl">';
              htm+='<a target="_blank" href="http://">' ;
              htm+='<img width="30" height="30" alt="久秇" src="'+data.img+'" ></a>';
           htm+='</div>';
           htm+= '<div class="list_con">';
           htm+= '<div class="WB_text">';
           htm+= '<a target="_blank" href="/5999598892" >'+data.username+'</a>:'+data.content+'</div>' ;
           htm+= '<div class="WB_expand_media_box" style="display: none;"></div>' ;
           htm+='<div class="WB_func clearfix"><div class="WB_handle W_fr">';
           htm+= '<ul class="clearfix">';
           htm+='<li class="hover"><span class="line S_line1"><a class="S_txt1 isdeli" href="javascript:void(0);" onclick="return false" del="hjli'+data.plid+'">删除</a></span></li>';
           htm+='<li> <span class="line S_line1">' ;
           htm+= '<a href="javascript:void(0);" class="S_txt1 " onclick="return false">回复</a>';
           htm+='</span><span class="arrow"><span class="W_arrow_bor W_arrow_bor_t"><i class="S_bg2_br"></i></span></span></li>';
           htm+=' <li><span class="line S_line1"><a href="javascript:void(0)" class="S_txt1" ><span node-type="like_status" class=""><em class="W_ficon ficon_praised S_txt2">ñ</em><em>赞</em></span></a></span></li>';
           htm+= '</ul></div>' ;
           htm+=  '<div class="WB_from S_txt2">'+data.time+'</div></div>';
           htm+=  '<div class="list_box_in S_bg3" style="display:none">' ;
           htm+=   '<div class="list_ul" node-type="child_comment"><div class="between_line S_bg1"></div></div></div></div></div>';

           $('#plparami'+a).prepend(htm);

       },
       error:function(){
           alert(2);
       }
    });
});

//
$('.isdeli').live('click',function(){
   var abc = $(this).attr('del');
   //alert('#'+abc);
   $('#'+abc).css('display','none');
});


$('#invietea').click(function(){
    $('#layerxhj').css('display','none');
});
//图片框
$('#wxqqcs').click(function(){
    $('#larveila').css('display','block');

});
$('#exitfilef').click(function(){
    $('#larveila').css('display','none');
});
//关注按钮
$('.clickif').live('click',function(){

    var selil = $(this).attr('molihua');
    var userid = $(this).attr('yid');
    var gzi = $(this).attr('gzi');

    $.ajax({
        type:'GET',
        url:'/setgz?userid='+userid,
        dataType:'json',
        success:function(data){

            if(data ==0 ){
             $('#'+gzi).html('关注');

            } else if(data ==1 ){
                $('#'+gzi).html('取消关注');
            } else if(data ==3){

                $('#'+gzi).html('推广微博');
            }
        },
        error:function(){
           alert(2);
        }
    });
    if($('#'+selil).css('display')=='none'){
        $('#'+selil).css('display','block');
    } else {
        $('#'+selil).css('display','none');
    }


});
//关注实现
$('.mydegz').live('click',function(){
    var zid = $(this).attr('zid');
    var res = $(this).attr('id');
    if($(this).html() == '关注' ){
        $.ajax({
            type:'get',
            url:'mygzt?zid='+zid+'&type=500',
            dataType:'json',
            success:function(data){


              $('#'+res).html('取消关注');
            },
            error:function(){
                alert(2);
            }
        })
    } else if($(this).html() == '取消关注'){
        $.ajax({
            type:'get',
            url:'mygzt?zid='+zid+'&type=100',
            dataType:'json',
            success:function(data){
                $('#'+res).html('关注');
            },
            error:function(){
                alert(2);
            }
        })
    }

})


 //发布系统
$('#pushccont').click(function(){
    var fontlength = $('#fontinput').val().length;
    var city = $('#pushccont').attr('city');
    if (fontlength>0) {

        //获取内容
        var content = $('#fontinput').val();
        $.ajax({
            type: "GET",
            url: '/makecontent?cont='+content+'&city='+city,
            dataType: "json",

            success: function(data){
                  var num = 1;
                function yangshi(){

                    $('#fontinput').val('');
                    $('#successci').css('display','block');
                    $('#inputnum').html(0);
                    $('#cotif').html('发布成功');
                    num++;
                    if(num > 13) {
                        clearInterval(fftime);
                        $('#successci').css('display','none');
                        $('#zlili').css('display','none');
                        $('#content-tj').css('display','block');
                        num = 1;
                    }
                }
                 fftime = setInterval(yangshi,100);
                //执行插入成功之后的模块
               var url =  "'http://www.803619.xin/resie?id="+data.id+"', 'newwindow', 'height=700, width=550, toolbar =yes, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no'";
              var myjs = 'onclick="javascript:window.open('+url+');"';
              var cont ='';
              cont+='<div class="WB_cardwrap WB_feed_type S_bg2 WB_feed_vipcover ksfsoni" id="ismycont'+data.id+'">';
                cont+='<!-- 主内容-->';
                cont+='<div class="WB_feed_detail clearfix">';
                cont+='<div class="WB_starcover">';
                cont+='<a href="javascript:void(0)" ></a>';
                cont+='</div>';
                cont+='<div class="WB_screen W_fr">';
                cont+='<div class="screen_box">';
                cont+='<a href="javascript:void(0);" class="clickif" molihua="contteni'+data.id+' " gzi="gzio'+data.id+'" yid="'+data.d_id+'">';
                cont+='<i class="W_ficon ficon_arrow_down S_ficon"><span class="glyphicon glyphicon-chevron-down" style="font-size:10px"></i>';
                cont+='</a>';
                cont+='<div class="layer_menu_list sonye" id="contteni'+data.id+'" style="display:none; position: absolute; z-index: 999;">';
                cont+='<ul>';
                cont+='<li>';
                cont+='<a href="javascript:void(0)" >帮上头条';
                cont+='</a>';
                cont+='</li>';
                cont+='<li>';
                cont+='<a  href="javascript:void(0)"  title="屏蔽这条微博">屏蔽这条微博';
                cont+='</a>';
                cont+='</li>';
                cont+='<li>';
                cont+='<a  href="javascript:void(0)"  title="屏蔽 男士时尚穿搭" id=>屏蔽 男士时尚穿搭';
                cont+='</a>';
                cont+='</li>';
                cont+='<li>';
                cont+='<a  href="javascript:void(0)"  id="gzio'+data.id+'">关注</a>';
                cont+='</li>';
                cont+='<li>';
                cont+='<a href="javascript:void(0)"  title="用此卡片背景">用此卡片背景';
                cont+='</a>';
                cont+='</li>';
                cont+='<li>';
                cont+='<a href="javascript:void(0);"'+myjs+' >举报';
                cont+='</a>';
                cont+='</li>';
                cont+='</ul>';
                cont+='<ul style="display:none;">';
                cont+='</ul>';
                cont+='</div>';
                cont+='</div>';
                cont+='</div>';
                cont+='<!-- 头像-->';
                cont+='<div class="WB_face W_fl">';
                cont+='<div class="face">';
                cont+='<a target="_blank" class="W_face_radius" href=>';
                cont+='<img  alt="" width="50" height="50" src="'+data.userimg+'" class="W_face_radius">';
                cont+='</a>';
                cont+='</div>';
                cont+='</div>';
                cont+='<!-- /头像-->';
                cont+='<!-- 内容-->';
                cont+='<div class="WB_detail">';
                cont+='<!--用户名-->';
                cont+='<div class="WB_info">';
                cont+='<a  target="_blank" class="W_f14 W_fb S_txt1"  title="男士时尚穿搭" href="">'+data.username;
                cont+='</a>';
                cont+='<a target="_blank"  href="http://">';
                cont+='<i title="微博个人认证 " class="W_icon icon_approve_gold">';
                cont+='</i>';
                cont+='</a>';
                cont+='<a  title="微博会员" target="_blank" href="http:/">';
                cont+='<em class="W_icon icon_member5">';
                cont+='</em>';
                cont+='</a>';
                cont+='</div>';
                cont+='<!-- 时间-->';
                cont+='<div class="WB_from S_txt2">';
                cont+='<!-- minzheng add part 2 -->';
                cont+='<a target="_blank" href=""   class="S_txt2"value=>'+data.d_time;
                cont+='</a>来自';
                cont+='<a class="S_txt2"  target="_blank" href="http://" >'+data.city+'</a>';                    cont+='<!-- minzheng add part 2 -->';
                cont+='</div>';
                cont+='<!-- 内容-->';
                cont+='<div class="WB_text W_f14">';
                cont+=data.d_cont;
                cont+='</div>';
                cont+='<div class="WB_expand_media_box " style="display: none;" ></div>';
                cont+='<!-- 引用文件时，必须对midia_info赋值 -->';
                cont+='<!-- 扩展区(图片-- 转发)-->';
                if(data.d_type ==1){

                } else if (data.d_type==2)
                {
                    cont += '<div class="WB_feed_expand">';
                    cont += '<div class="W_arrow_bor W_arrow_bor_t"><i class="S_bg1_br"></i></div>';
                    cont += '<!--主内容区-->';
                    cont += '<div class="WB_expand S_bg1" >';
                    cont += '<!-- 发帖人信息-->';
                    cont += '<div class="WB_info">';
                    cont += '<a target="_blank"  class="W_fb S_txt1"href="">';
                    cont += '名字出';
                    cont += '</a></div>';
                    cont += '<div class="WB_text">';
                    cont += '内容出';
                    cont += '<img render="ext" src="http" ">';
                    cont += '<img render="ext" src="http://"  style="visibility: visible;">';
                    cont += '<img render="ext" src="http://"  type="face" style="visibility: visible;">一个瓜皮十五万';
                    cont += '<img render="ext" src="http://"  style="visibility: visible;">';
                    cont += '<img render="ext" src="http://" style="visibility: visible;">';
                    cont += '<img render="ext" src="http://"  style="visibility: visible;">';
                    cont += '<img render="ext" src="http://"  style="visibility: visible;">';
                    cont += '<a target="_blank" render="ext"  href="http://">@在下萝莉控ii';
                    cont += '--</a>';
                    cont += '</div>';
                    cont += '<div class="WB_expand_media_box" style="display: none;" ></div>';
                    cont += '<!-- 微博心情，独立于标准的ul节点 -->';
                    cont += '<!--扩展区-->';
                } else if (data.d_type==3)
                {
                    cont += '<div class="WB_media_wrap clearfix" >';
                    cont += '<!--图片区-->';
                    cont += '<div class="media_box">';
                    cont += '<ul class="WB_media_a WB_media_a_mn WB_media_a_m5 clearfix">';
                    cont += '<li class="WB_pic li_1 S_bg1 S_line2 bigcursor" >';
                    cont += '<img src="http://">';
                    cont += '</li>';
                    cont += '<li class="WB_pic li_2 S_bg1 S_line2 bigcursor">';
                    cont += '<img src="http://">';
                    cont += '</li>';
                    cont += '<li class="WB_pic li_3 S_bg1 S_line2 bigcursor">';
                    cont += '<img src="http://">';
                    cont += '</li>';
                    cont += '<li class="WB_pic li_4 S_bg1 S_line2 bigcursor">';
                    cont += '<img src="http://">';
                    cont += '</li>';
                    cont += '<li class="WB_pic li_5 S_bg1 S_line2 bigcursor">';
                    cont += ' <img src="http://">';
                    cont += '</li>';
                    cont += '</ul>';
                    cont += '</div>';
                    cont += '</div>';
                    cont += '<!-- super topic card -->';
                    cont += '<div class="WB_func clearfix">';
                    cont += '<div class="WB_handle W_fr" >';
                    cont += '</div>';
                    cont += '<div class="WB_from S_txt2">';
                    cont += '<a class="S_txt2" target="_blank" href=""  >时间';
                    cont += '</a> 来自<a class="S_txt2"  target="_blank" href="http://" >'+data.u_equi+'</a>';
                    cont += '</div>';
                    cont += '</div>';
                    cont += '</div>';
                    cont += '</div>';
                }else if (data.d_type==3)
                {
                    cont += '<div class="WB_feed_expand">';
                    cont += '<div class="W_arrow_bor W_arrow_bor_t">';
                    cont += '<i class="S_bg1_br"></i>';
                    cont += '</div>';
                    cont += '<div class="WB_expand S_bg1">';
                    cont += '<div class="WB_empty">';
                    cont += '<div class="WB_innerwrap">';
                    cont += '<div class="empty_con clearfix">';
                    cont += '<p class="WB_text W_f14"><i class="W_icon icon_warnS"></i>抱歉，此微博已被作者删除。查看帮助：<a class="W_btn_b btn_22px W_btn_cardlink" title="http://t.cn/Rfd3rQV" href="http://t.cn/Rfd3rQV" target="_blank" action-type="feed_list_url"><i class="W_ficon ficon_cd_link S_ficon">O</i><i class="W_vline S_line1"></i><em class="W_autocut S_link1">网页链接</em></a> </p>';
                    cont += '</div>';
                    cont += '</div>';
                    cont += '</div>';
                    cont += '</div>';
                    cont += '</div>';
                } else if (data.d_type==4)
                {
                    cont += '<div class="WB_media_wrap clearfix" >';
                    cont += '<div class="media_box">&gt';
                    cont += '<!--图片个数大于1，不渲染卡片-->';
                    cont += '<!--TODO 只显示图片-->';
                    cont += '<!--picture_count == 4-->';
                    cont += '<ul class="WB_media_a WB_media_a_mn WB_media_a_m4 clearfix">';
                    cont += '<li class="WB_pic li_1 S_bg1 S_line2 bigcursor" >';
                    cont += '<img src="http://">';
                    cont += '</li>';
                    cont += '<li class="WB_pic li_2 S_bg1 S_line2 bigcursor" >';
                    cont += '<img src="http://">';
                    cont += '</li>';
                    cont += '<li class="WB_pic li_3 S_bg1 S_line2 bigcursor" >';
                    cont += '<img src="http://">';
                    cont += '</li>';
                    cont += '<li class="WB_pic li_4 S_bg1 S_line2 ">';
                    cont += '<img src="">';
                    cont += '</li>';
                    cont += '</ul>';
                    cont += '</div>';
                    cont += '</div>';
                    cont += '<!-- -->';
                }

                   cont+='</div>';
                cont+='<!-- /内容-->';
                cont+='</div>';
                cont+='<!--/主内容-->';
                cont+='<!-- 收藏点赞-->';
                cont+='<div class="WB_feed_handle">';
                cont+='<div class="WB_handle">';
                cont+='<ul class="WB_row_line WB_row_r4 clearfix S_line2">';
                cont+='<li>';
                cont+='<a class="S_txt2"  href="javascript:void(0);">';
                cont+='<span class="pos">';
                cont+='<span class="line S_line1" ><span>';
                cont+='<em class="W_ficon ficon_favorite S_ficon">û';
                cont+='</em>';
                cont+='<em>收藏';
                cont+='</em>';
                cont+='</span>';
                cont+='</span>';
                cont+='</span>';
                cont+='</a>';
                cont+='</li>';
                cont+='<li>';
                cont+='<a class="S_txt2 thezf" href="javascript:void(0);" zid="'+data.id+'">';
                cont+='<span class="pos">';
                cont+='<span class="line S_line1" ><span>';
                cont+='<em class="W_ficon ficon_forward S_ficon">';
                cont+='</em>';
                cont+='<em>转发';
                cont+='</em>';
                cont+='</span></span></span></a>';
                cont+='</li>';
                cont+='<li>';
                cont+='<a class="S_txt2 My_pl"  href="javascript:void(0);" mydb="'+data.id+'" myimg="'+data.userimg+'">';
                cont+='<span class="pos"><span class="line S_line1" >';
                cont+='<span>';
                cont+='<em class="W_ficon ficon_repeat S_ficon">';
                cont+='</em>';
                cont+='<em>评论';
                cont+='</em>';
                cont+='</span>';
                cont+='</span>';
                cont+='</span>';
                cont+='</a>';
                cont+='<span class="arrow" style="display: none;" >';
                cont+='<span class="W_arrow_bor W_arrow_bor_t"><i class="S_line1">';
                cont+='</i>';
                cont+='<em class="S_bg1_br"></em>';
                cont+='</span>';
                cont+='</span>';
                cont+='</li>';
                cont+='<li>';
                cont+='<a href="javascript:void(0);" class="S_txt2"  title="赞">';
                cont+='<span class="pos">';
                cont+='<span class="line S_line1">';
                cont+='<span  class="">';
                cont+='<em class="W_ficon ficon_praised S_txt2">ñ</em>';
                cont+='<em>'+data.like+'</em>';
                cont+='</span>';
                cont+='</span>';
                cont+='</span></a>';
                cont+='</li>';
                cont+='</ul>';
                cont+='</div>';
                cont+='</div>';
                cont+='<!-- /收藏点赞-->';
                cont+='<!-- 评论-->';
                cont+='</div>';
                console.log(cont);
              $(cont).prependTo('#mysupercont');



            },
            error: function(){
                var num = 1;
                function yangshi(){

                    $('#fontinput').val('');
                    $('#successci').css('display','block');
                    $('#inputnum').html(0);
                    $('#cotif').html('发布错误');
                    num++;
                    if(num > 3) {
                        clearInterval(qtime);
                        $('#successci').css('display','none');
                        $('#zlili').css('display','none');
                        $('#content-tj').css('display','block');
                        num = 1;
                    }
                }
                qtime = setInterval(yangshi,200);
            }




        });

    } else {
        var num = 1;
        function yangshi(){
            $('#successci').css('display','block');
            $('#cotif').html('请输入内容');
            num++;
            if(num > 3) {
                clearInterval(ftime);
                $('#successci').css('display','none');
                num = 1;
            }
        }
        ftime = setInterval(yangshi,200);
    }
});//发布入口

//转发入口
$('.thezf').live('click',function(){
    $('#mydemo').css('display','block');
    var zid = $(this).attr('zid');
    $.ajax({
        type:'get',
        url:'zfinfo?zid='+zid,
        dataType:'json',
        success:function(data){
           $('#motipe').html('@'+data.username);
           $('#moticon').html(data.cont);
           $('#wodezfi').attr('did',data.id);
        },
        error:function(){
           alert(2);
        }
    })


});
//关闭转发mok
$('#qumot').click(function(){
    $('#mydemo').css('display','none');
});
//发布zf
$('#wodezfi').click(function(){
   var content = $('#supercontia').val();
   var zid = $(this).attr('did');

   $.ajax({
     type:'get',
     url:'weizf?zid='+zid+'&cont='+content,
     dataType:'json',
     success:function(data){
         $('#mydemo').css('display','none');
         //执行插入后
         var url =  "'http://www.803619.xin/resie?id="+data.id+"', 'newwindow', 'height=700, width=550, toolbar =yes, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no'";
         var myjs = 'onclick="javascript:window.open('+url+');"';
         var cont ='';
         cont+='<div class="WB_cardwrap WB_feed_type S_bg2 WB_feed_vipcover ksfsoni" id="ismycont'+data.id+'">';
         cont+='<!-- 主内容-->';
         cont+='<div class="WB_feed_detail clearfix">';
         cont+='<div class="WB_starcover">';
         cont+='<a href="javascript:void(0)" ></a>';
         cont+='</div>';
         cont+='<div class="WB_screen W_fr">';
         cont+='<div class="screen_box">';
         cont+='<a href="javascript:void(0);" class="clickif" molihua="contteni'+data.id+' " gzi="gzio'+data.id+'" yid="'+data.d_id+'">';
         cont+='<i class="W_ficon ficon_arrow_down S_ficon"><span class="glyphicon glyphicon-chevron-down" style="font-size:10px"></i>';
         cont+='</a>';
         cont+='<div class="layer_menu_list sonye" id="contteni'+data.id+'" style="display:none; position: absolute; z-index: 999;">';
         cont+='<ul>';
         cont+='<li>';
         cont+='<a href="javascript:void(0)" >帮上头条';
         cont+='</a>';
         cont+='</li>';
         cont+='<li>';
         cont+='<a  href="javascript:void(0)"  title="屏蔽这条微博">屏蔽这条微博';
         cont+='</a>';
         cont+='</li>';
         cont+='<li>';
         cont+='<a  href="javascript:void(0)"  title="屏蔽 男士时尚穿搭" id=>屏蔽 男士时尚穿搭';
         cont+='</a>';
         cont+='</li>';
         cont+='<li>';
         cont+='<a  href="javascript:void(0)"  id="gzio'+data.id+'">关注</a>';
         cont+='</li>';
         cont+='<li>';
         cont+='<a href="javascript:void(0)"  title="用此卡片背景">用此卡片背景';
         cont+='</a>';
         cont+='</li>';
         cont+='<li>';
         cont+='<a href="javascript:void(0);"'+myjs+' >举报';
         cont+='</a>';
         cont+='</li>';
         cont+='</ul>';
         cont+='<ul style="display:none;">';
         cont+='</ul>';
         cont+='</div>';
         cont+='</div>';
         cont+='</div>';
         cont+='<!-- 头像-->';
         cont+='<div class="WB_face W_fl">';
         cont+='<div class="face">';
         cont+='<a target="_blank" class="W_face_radius" href=>';
         cont+='<img  alt="" width="50" height="50" src="'+data.userimg+'" class="W_face_radius">';
         cont+='</a>';
         cont+='</div>';
         cont+='</div>';
         cont+='<!-- /头像-->';
         cont+='<!-- 内容-->';
         cont+='<div class="WB_detail">';
         cont+='<!--用户名-->';
         cont+='<div class="WB_info">';
         cont+='<a  target="_blank" class="W_f14 W_fb S_txt1"  title="男士时尚穿搭" href="">'+data.username;
         cont+='</a>';
         cont+='<a target="_blank"  href="http://">';
         cont+='<i title="微博个人认证 " class="W_icon icon_approve_gold">';
         cont+='</i>';
         cont+='</a>';
         cont+='<a  title="微博会员" target="_blank" href="http:/">';
         cont+='<em class="W_icon icon_member5">';
         cont+='</em>';
         cont+='</a>';
         cont+='</div>';
         cont+='<!-- 时间-->';
         cont+='<div class="WB_from S_txt2">';
         cont+='<!-- minzheng add part 2 -->';
         cont+='<a target="_blank" href=""   class="S_txt2"value=>'+data.d_time;
         cont+='</a>来自';
         cont+='<a class="S_txt2"  target="_blank" href="http://" >'+data.city+'</a>';                    cont+='<!-- minzheng add part 2 -->';
         cont+='</div>';
         cont+='<!-- 内容-->';
         cont+='<div class="WB_text W_f14">';
         cont+=data.cont;
         cont+='</div>';
         cont+='<div class="WB_expand_media_box " style="display: none;" ></div>';
         cont+='<!-- 引用文件时，必须对midia_info赋值 -->';
         cont+='<!-- 扩展区(图片-- 转发)-->';
         if(data.d_type ==1){

         } else if (data.d_type==2)
         {
             cont += '<div class="WB_feed_expand">';
             cont += '<div class="W_arrow_bor W_arrow_bor_t"><i class="S_bg1_br"></i></div>';
             cont += '<!--主内容区-->';
             cont += '<div class="WB_expand S_bg1" >';
             cont += '<!-- 发帖人信息-->';
             cont += '<div class="WB_info">';
             cont += '<a target="_blank"  class="W_fb S_txt1"href="">';
             cont += data.zfname;
             cont += '</a></div>';
             cont += '<div class="WB_text">';
             cont += data.zfcont;
             // cont += '<img render="ext" src="http" ">';
             // cont += '<img render="ext" src="http://"  style="visibility: visible;">';
             // cont += '<img render="ext" src="http://"  type="face" style="visibility: visible;">一个瓜皮十五万';
             // cont += '<img render="ext" src="http://"  style="visibility: visible;">';
             // cont += '<img render="ext" src="http://" style="visibility: visible;">';
             // cont += '<img render="ext" src="http://"  style="visibility: visible;">';
             // cont += '<img render="ext" src="http://"  style="visibility: visible;">';

             cont += '--</a>';
             cont += '</div>';
             cont += '<div class="WB_expand_media_box" style="display: none;" ></div>';
             cont += '<!-- 微博心情，独立于标准的ul节点 -->';
             cont += '<!--扩展区-->';
         } else if (data.d_type==3)
         {
             cont += '<div class="WB_media_wrap clearfix" >';
             cont += '<!--图片区-->';
             cont += '<div class="media_box">';
             cont += '<ul class="WB_media_a WB_media_a_mn WB_media_a_m5 clearfix">';
             cont += '<li class="WB_pic li_1 S_bg1 S_line2 bigcursor" >';
             cont += '<img src="http://">';
             cont += '</li>';
             cont += '<li class="WB_pic li_2 S_bg1 S_line2 bigcursor">';
             cont += '<img src="http://">';
             cont += '</li>';
             cont += '<li class="WB_pic li_3 S_bg1 S_line2 bigcursor">';
             cont += '<img src="http://">';
             cont += '</li>';
             cont += '<li class="WB_pic li_4 S_bg1 S_line2 bigcursor">';
             cont += '<img src="http://">';
             cont += '</li>';
             cont += '<li class="WB_pic li_5 S_bg1 S_line2 bigcursor">';
             cont += ' <img src="http://">';
             cont += '</li>';
             cont += '</ul>';
             cont += '</div>';
             cont += '</div>';
             cont += '<!-- super topic card -->';
             cont += '<div class="WB_func clearfix">';
             cont += '<div class="WB_handle W_fr" >';
             cont += '</div>';
             cont += '<div class="WB_from S_txt2">';
             cont += '<a class="S_txt2" target="_blank" href=""  >时间';
             cont += '</a> 来自<a class="S_txt2"  target="_blank" href="http://" >'+data.u_equi+'</a>';
             cont += '</div>';
             cont += '</div>';
             cont += '</div>';
             cont += '</div>';
         }else if (data.d_type==3)
         {
             cont += '<div class="WB_feed_expand">';
             cont += '<div class="W_arrow_bor W_arrow_bor_t">';
             cont += '<i class="S_bg1_br"></i>';
             cont += '</div>';
             cont += '<div class="WB_expand S_bg1">';
             cont += '<div class="WB_empty">';
             cont += '<div class="WB_innerwrap">';
             cont += '<div class="empty_con clearfix">';
             cont += '<p class="WB_text W_f14"><i class="W_icon icon_warnS"></i>抱歉，此微博已被作者删除。查看帮助：<a class="W_btn_b btn_22px W_btn_cardlink" title="http://t.cn/Rfd3rQV" href="http://t.cn/Rfd3rQV" target="_blank" action-type="feed_list_url"><i class="W_ficon ficon_cd_link S_ficon">O</i><i class="W_vline S_line1"></i><em class="W_autocut S_link1">网页链接</em></a> </p>';
             cont += '</div>';
             cont += '</div>';
             cont += '</div>';
             cont += '</div>';
             cont += '</div>';
         } else if (data.d_type==4)
         {
             cont += '<div class="WB_media_wrap clearfix" >';
             cont += '<div class="media_box">&gt';
             cont += '<!--图片个数大于1，不渲染卡片-->';
             cont += '<!--TODO 只显示图片-->';
             cont += '<!--picture_count == 4-->';
             cont += '<ul class="WB_media_a WB_media_a_mn WB_media_a_m4 clearfix">';
             cont += '<li class="WB_pic li_1 S_bg1 S_line2 bigcursor" >';
             cont += '<img src="http://">';
             cont += '</li>';
             cont += '<li class="WB_pic li_2 S_bg1 S_line2 bigcursor" >';
             cont += '<img src="http://">';
             cont += '</li>';
             cont += '<li class="WB_pic li_3 S_bg1 S_line2 bigcursor" >';
             cont += '<img src="http://">';
             cont += '</li>';
             cont += '<li class="WB_pic li_4 S_bg1 S_line2 ">';
             cont += '<img src="">';
             cont += '</li>';
             cont += '</ul>';
             cont += '</div>';
             cont += '</div>';
             cont += '<!-- -->';
         }

         cont+='</div>';
         cont+='<!-- /内容-->';
         cont+='</div>';
         cont+='<!--/主内容-->';
         cont+='<!-- 收藏点赞-->';
         cont+='<div class="WB_feed_handle">';
         cont+='<div class="WB_handle">';
         cont+='<ul class="WB_row_line WB_row_r4 clearfix S_line2">';
         cont+='<li>';
         cont+='<a class="S_txt2"  href="javascript:void(0);">';
         cont+='<span class="pos">';
         cont+='<span class="line S_line1" ><span>';
         cont+='<em class="W_ficon ficon_favorite S_ficon">û';
         cont+='</em>';
         cont+='<em>收藏';
         cont+='</em>';
         cont+='</span>';
         cont+='</span>';
         cont+='</span>';
         cont+='</a>';
         cont+='</li>';
         cont+='<li>';
         cont+='<a class="S_txt2" href="javascript:void(0);" >';
         cont+='<span class="pos">';
         cont+='<span class="line S_line1" ><span>';
         cont+='<em class="W_ficon ficon_forward S_ficon">';
         cont+='</em>';
         cont+='<em>转发';
         cont+='</em>';
         cont+='</span></span></span></a>';
         cont+='</li>';
         cont+='<li>';
         cont+='<a class="S_txt2 My_pl"  href="javascript:void(0);" mydb="'+data.id+'" myimg="'+data.userimg+'">';
         cont+='<span class="pos"><span class="line S_line1" >';
         cont+='<span>';
         cont+='<em class="W_ficon ficon_repeat S_ficon">';
         cont+='</em>';
         cont+='<em>评论';
         cont+='</em>';
         cont+='</span>';
         cont+='</span>';
         cont+='</span>';
         cont+='</a>';
         cont+='<span class="arrow" style="display: none;" >';
         cont+='<span class="W_arrow_bor W_arrow_bor_t"><i class="S_line1">';
         cont+='</i>';
         cont+='<em class="S_bg1_br"></em>';
         cont+='</span>';
         cont+='</span>';
         cont+='</li>';
         cont+='<li>';
         cont+='<a href="javascript:void(0);" class="S_txt2"  title="赞">';
         cont+='<span class="pos">';
         cont+='<span class="line S_line1">';
         cont+='<span  class="">';
         cont+='<em class="W_ficon ficon_praised S_txt2">ñ</em>';
         cont+='<em>'+data.like+'</em>';
         cont+='</span>';
         cont+='</span>';
         cont+='</span></a>';
         cont+='</li>';
         cont+='</ul>';
         cont+='</div>';
         cont+='</div>';
         cont+='<!-- /收藏点赞-->';
         cont+='<!-- 评论-->';
         cont+='</div>';
         //console.log(cont);
         $(cont).prependTo('#mysupercont');


         //
     },
      error:function(){
         alert(2);
      }

   });//ajax入口
});

//瀑布流

    $(function(){
        /*瀑布流开始*/
        var container = $('#mysupercont');
        var loading=$('#zwkmyson');
        //console.log(loading);
        var sqlJson=[];
        var skip = 12;//每次数据
        var count = 5;
        var sqlfind=[];
        var search='index';
        var newstype='';
        var type='none';
        //获取后台统计信息数据
        $.ajax({
            url:'getinfocount',
            type:'get',
            // async:false,
            success:function(data){
                count = data;
                //skip = 12;

            },
            error:function(data){
            }
        });
//初始化load
        // 侧边栏到底改变css

        //     if ( $(document).height() - $(document).scrollTop() <= 900 ) {
        // $(window).scroll(function(){
        //         $('#kanmegi').css('display','block');
        //
        //     } else {
        //         $('#kanmegi').css('display','none');
        //     }
        // });




        loading.data("on",true);
        container.imagesLoaded(function(){
            container.masonry({
                columnWidth: 600,
                itemSelector : '.ksfsoni',
                isFitWidth: true,//是否根据浏览器窗口大小自动适应默认false
                isAnimated: true,//是否采用jquery动画进行重拍版
                isRTL:false,//设置布局的排列方式，即：定位砖块时，是从左向右排列还是从右向左排列。默认值为false，即从左向右
                isResizable: true,//是否自动布局默认true
                animationOptions: {
                    duration: 800,
                    easing: 'easeInOutBack',//如果你引用了jQeasing这里就可以添加对应的动态动画效果，如果没引用删除这行，默认是匀速变化
                    queue: false//是否队列，从一点填充瀑布流
                }
            });
        });

        $(window).scroll(function(){
            if(!loading.data('on')){
                return;
            }

            //alert(1);
            var itemNum=$('#mysupercont').find('.ksfsoni').length;

            var itemArr=[];
            document.title = itemNum;
            itemArr[0]=$('#mysupercont').find('.ksfsoni').eq(itemNum-1).offset().top+$('#mysupercont').find('.ksfsoni').eq(itemNum-1)[0].offsetHeight;
            var maxTop=Math.max.apply(null,itemArr);
            if(maxTop<$(window).height()+$(document).scrollTop()){
                //console.log('fsfs');

                $.ajax({
                    // url:'content?skip='+skip+'&search='+search+'&topic='+newstype,
                    type:'get',
                    url:'getinfo?skip='+skip+'&section='+search,
                    dataType:'json',
                    // async:false,
                    success:function(data){
                        sqlJson = data;
                         console.log(sqlJson);

                    },
                    error:function(data){
                    }
                });
                //加载更多语句
                //console.log(sqlJson);
                loading.data("on",false);
                $('#zwkmyson').css('display','block');
                (function(sqlJson){


                    if(itemNum>=count){
                        // container.append('<div class="WB_cardwrap S_bg2"><div class="WB_empty" ><div class="WB_innerwrap"><div class="empty_con clearfix"> <p class="text"><i class="W_loading"></i>已加载完毕</p> </div> </div> </div> </div>');
                        //$('#lmcsli').html('已加载全部');

                    } else {
                        var html="";
                        skip = skip + 12;
                        //var value = 1;
                        for(var i =0; i<sqlJson.length;i++){

              var imgurl = 1,imgURL =sqlJson[i].userimg ,name = sqlJson[i].username,renzeng =1,huiyuan=1,timeurl=sqlJson[i].d_time,kuangzhang=1,conte=sqlJson[i].content,equi=sqlJson[i].d_equi,id=sqlJson[i].id,d_id=sqlJson[i].d_id,like=sqlJson[i].d_like;
                            var surl =  "'http://www.803619.xin/resie?id="+sqlJson[i].id+"', 'newwindow', 'height=700, width=550, toolbar =yes, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no'";
                            var myjs = 'onclick="javascript:window.open('+surl+');"';


     html +='<div class="WB_cardwrap WB_feed_type S_bg2 WB_feed_vipcover ksfsoni" ><!-- 主内容--><div class="WB_feed_detail clearfix" ><!--WB_starcover--><div class="WB_starcover"><a href="javascript:void(0)" ></a></div><!-- WB_screen W_fr --><div class="WB_screen W_fr"><div class="screen_box"><a href="javascript:void(0);" class="clickif" molihua="contteni'+id+'" gzi="gzio'+id+'" yid='+d_id+' ><i class="W_ficon ficon_arrow_down S_ficon">c</i></a><div class="layer_menu_list"  style="display:none; position: absolute; z-index: 999;" id="contteni'+id+'"><ul><li><a href="javascript:void(0)" >帮上头条</a></li><li><a  href="javascript:void(0)"  title="屏蔽这条微博">屏蔽这条微博</a></li><li><a  href="javascript:void(0)"  title="屏蔽 男士时尚穿搭">屏蔽 男士时尚穿搭</a></li><li><a  href="javascript:void(0)"  class="class="mydegz"" id="gzio'+id+'"zid="'+d_id+'">取消关注男士时尚穿搭</a> </li><li><a href="javascript:void(0)"  title="用此卡片背景">用此卡片背景</a></li><li> <a href="javascript:void(0);"'+myjs+'>举报</a></li></ul><ul style="display:none;" ></ul></div></div></div> <!-- 头像--><div class="WB_face W_fl"><div class="face"><a target="_blank" class="W_face_radius" href="'+imgurl+'"><img  alt="" width="50" height="50" src="'+imgURL+'" class="W_face_radius"></a></div></div><!-- /头像--><!-- 内容--><div class="WB_detail"><!--用户名--><div class="WB_info"><a  target="_blank" class="W_f14 W_fb S_txt1"   href="'+name+'"></a><a target="_blank"  href="http://'+renzeng+'"><i title="微博个人认证 " class="W_icon icon_approve_gold"></i></a><a  title="微博会员" target="_blank" href="http:/'+huiyuan+'"><em class="W_icon icon_member5"></em></a></div><!-- 时间--><div class="WB_from S_txt2"><a target="_blank" href="'+timeurl+'"  class="S_txt2"value=>'+timeurl+'</a> 来自<a class="S_txt2"  target="_blank" href="http://" >'+equi+'</a></div><!-- 用户内容--><div class="WB_text W_f14">'+conte+'</div><div class="WB_expand_media_box " style="display: none;" ></div><!-- 扩展区(图片-- 转发)-->'+kuangzhang+'<!--/扩展 --></div></div><!-- 收藏点赞--><div class="WB_feed_handle"><div class="WB_handle"><ul class="WB_row_line WB_row_r4 clearfix S_line2"><li><a class="S_txt2 mysupsc"  href="javascript:void(0);" sid="'+id+'"><span class="pos"><span class="line S_line1" ><span><em class="W_ficon ficon_favorite S_ficon" supqi="'+id+'"><span class="glyphicon glyphicon-star-empty"></span></em><em>收藏</em></span></span></span></a></li><li><a class="S_txt2 thezf" href="javascript:void(0);" zid="'+id+'"><span class="pos">  <span class="line S_line1" ><span><em class="W_ficon ficon_forward S_ficon"><span class="glyphicon glyphicon-share"></span></em><em>转发</em></span></span></span></a></li><li><a class="S_txt2 My_pl"  href="javascript:void(0);" mydb="'+id+'" "myimg='+imgURL+'"><span class="pos"><span class="line S_line1" ><span><em class="W_ficon ficon_repeat S_ficon"><span class="glyphicon glyphicon-edit"></span></em><em>'+like+'</em></span></span></span></a><span class="arrow" style="display: none;" ><span class="W_arrow_bor W_arrow_bor_t"><i class="S_line1"></i><em class="S_bg1_br"></em></span></span></li><li><a href="javascript:void(0);" class="S_txt2 lmdzi" zidi="'+id+'" > <span class="pos"><span class="line S_line1"><span node-type="like_status" class=""><em class="W_ficon ficon_praised S_txt2"><span class="glyphicon glyphicon-thumbs-up"></span></em><em>'+like+'</em></span></span></span></a></li></ul></div></div><!-- /收藏点赞--><div  class="WB_feed_repeat S_bg1" style="display:none;"></div></div>';



                        }//for入口
                         //将请求数据延时800毫
                        var time = setTimeout(function(){
                            var $newElems = $(html).css({ opacity: 0}).appendTo(container);
                            $newElems.imagesLoaded(function(){
                                $newElems.animate({opacity:1},800);
                                container.masonry('appended',$newElems,true);
                                loading.data("on",true);
                                clearTimeout(time);

                            });
                        },800);//800入口

                    }//else 入口

                })(sqlJson);

            }//if语句入口

        });//时间入口



    });//入口函数

//图片上传方法

// $('input').ssi_uploader({url:'www.803619.xin/imgupload',onUpload:function(){
//     console.log('文件上传完毕！');
// }})



